<?php


// $user = $this->users();
// $user->login = 'ggyorfi7';
// $user->change_password('titkos123');
// 
// error_log(print_r(($user->_f_pkey_),1));
// $user->save();
// error_log(print_r(($user->_f_pkey_),1));
// 
// $results = $this->db()->select('user')
// 	->exec();
// 
// foreach ($results as $obj) print_r($obj);

// $user = $this->users('ggyorfi7');
// $user->salt  = "heloka";
// $user->save();

// echo '<table>';
// foreach ($this->find_all_users()->select()->where("login > 'ggyorfi4'")->exec() as $user) {
// 	echo "<tr><td style='border: 1px solid red;'>$user->login</td><td style='border: 1px solid red;'>$user->salt</td></tr>";
// }
// echo '</table>';

$form = $this->form('grid-form')
	->grid('grid','Grid',array(
			'login' => 'Login name',
			'password' => 'Password',
			'salt' => 'Salt',
		),$this->users()->find_all(),array(
			'toolbar' => array(
				'add' => array('label' => 'Add', 'action' => '/grid/add'),
			),
			'buttons' => array(
				'modify' => array('label' => 'Modify', 'action' => '/grid/modify/{#}'),
				'delete' => array('label' => 'Delete', 'action' => '/grid/delete/{#}'),
			),
			'select' => true,
		))
	->render();

?>
